# -*-coding: UTF-8 -*-
# @File : fakeUtil .py
# author: huangchen
# Time：2024/1/10 
import random
import string


def fake_digits(length):
    """生成指定长度的数字字符串"""
    return ''.join(random.choices(string.digits, k=length))


def fake_english_string(length):
    """生成指定长度的英文字符串"""
    letters = string.ascii_letters
    return ''.join(random.choices(letters, k=length))


def fake_chinese_string(length):
    """生成指定长度的中文字符串"""
    # 中文字符的Unicode范围
    chinese_chars = [chr(i) for i in range(0x4e00, 0x9fa5)]
    return ''.join(random.choices(chinese_chars, k=length))


# 测试代码
if __name__ == "__main__":
    print("数字字符串:", fake_digits(10))
    print("英文字符串:", fake_english_string(10))
    print("中文字符串:", fake_chinese_string(10))
